package com.glela.platform.vo;

import org.apache.commons.lang3.StringUtils;

import com.glela.platform.model.UserPromotion;

/**
 * @author liujie
 * @2016年10月26日
 */
public class UserPromotionVo extends UserPromotion {
	private long discountAmount; //折扣金额

	public UserPromotionVo() {
		super();
	}

	public UserPromotionVo(UserPromotion up) {
		super();
		this.setId(up.getId());
		this.setPromotionId(up.getPromotionId());
		this.setPromotionDetailId(up.getPromotionDetailId());
		this.setType(up.getType());
		this.setPromotionDetailName(up.getPromotionDetailName());
		this.setUserId(up.getUserId());
		this.setBrandId(up.getBrandId());
		this.setGoodId(up.getGoodId());
		this.setLimited(up.getLimited());
		this.setIsDiscount(up.getIsDiscount());
		this.setAmount(up.getAmount());
		this.setDiscount(up.getDiscount());
		this.setEffectiveTime(up.getEffectiveTime());
		this.setExpirationTime(up.getExpirationTime());
		this.setPromotionNumber(up.getPromotionNumber());
		this.setStatus(up.getStatus());
		this.setTargetSelfType(up.getTargetSelfType());
	}

	/** 用户优惠券ID */
	public int getUserPromotionId() {
		return getId();
	}

	/** 用户优惠券ID */
	@Override
	public int getPromotionDetailId() {
		return getId();
	}

	/** 折扣金额 */
	public long getDiscountAmount() {
		return discountAmount;
	}

	/** 折扣金额 */
	public void setDiscountAmount(long discountAmount) {
		this.discountAmount = discountAmount;
	}

	/** 有效日期 */
	@Override
	public String getEffectiveTime() {
		return StringUtils.substring(super.getEffectiveTime(), 0, 10);
	}

	/** 失效时间 */
	@Override
	public String getExpirationTime() {
		return StringUtils.substring(super.getExpirationTime(), 0, 10);
	}
}